home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / • Other Platforms / PCCTS 1.31 / non-MPW / NOTES.MSVC < prev    next >
Encoding:
Text File  |  1995-03-10  |  19.3 KB  |  637 lines  |  [TEXT/MPS ]

  1.                         Microsoft Visual C Stuff
  2.  
  3. [This file contains notes on MSVC for Windows NT console execs by Dave
  4.  Seidel and an explanation of flags etc.. by John Hall; good luck,
  5.  Terence]
  6.  
  7. Date: Sat, 31 Dec 1994 11:40:36 -0500 (EST)
  8. From: David Seidel <75342.2034@compuserve.com>
  9.  
  10. I've succesfully build 1.31b3 with djgpp for DOS and MSVC 2.0 for Windows 
  11. NT.  The only (minor) problem I had was that GNU make (version 3.71, in the 
  12. djgpp port) complained about "multiple targets" in both the antlr and dlg 
  13. makefiles.  I got around the error by, in each makefile, commenting out the 
  14. $(SRC) dependency, for example:
  15.  
  16.    antlr: $(OBJ) #$(SRC)
  17.  
  18. I don't know why this is happenning, since you haven't changed that part of 
  19. the makefile at all, and I think this used to work ok...
  20.  
  21. Here are the makefiles I built from within the MSVC 2.0 environment for antlr 
  22. and dlg and Windows NT console executables.  Please feel free to pass them 
  23. on.  Of course, as soon as 1.31 "goes gold", I will send you nice new 
  24. binaries.  I'm not going to bother to keep doing both Borland and djgpp for 
  25. DOS however.  Instead, I'll just keep the djgpp version up to date and also 
  26. provide WinNT binaries.
  27.  
  28. Dave
  29.  
  30. File antlr.mak:
  31.  
  32. # Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
  33. # ** DO NOT EDIT **
  34.  
  35. # TARGTYPE "Win32 (x86) Console Application" 0x0103
  36.  
  37. !IF "$(CFG)" == ""
  38. CFG=Win32 Debug
  39. !MESSAGE No configuration specified.  Defaulting to Win32 Debug.
  40. !ENDIF 
  41.  
  42. !IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
  43. !MESSAGE Invalid configuration "$(CFG)" specified.
  44. !MESSAGE You can specify a configuration when running NMAKE on this makefile
  45. !MESSAGE by defining the macro CFG on the command line.  For example:
  46. !MESSAGE 
  47. !MESSAGE NMAKE /f "antlr.mak" CFG="Win32 Debug"
  48. !MESSAGE 
  49. !MESSAGE Possible choices for configuration are:
  50. !MESSAGE 
  51. !MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
  52. !MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
  53. !MESSAGE 
  54. !ERROR An invalid configuration is specified.
  55. !ENDIF 
  56.  
  57. ##############################################################################
  58. ## # Begin Project
  59. # PROP Target_Last_Scanned "Win32 Debug"
  60. CPP=cl.exe
  61. RSC=rc.exe
  62.  
  63. !IF  "$(CFG)" == "Win32 Release"
  64.  
  65. # PROP BASE Use_MFC 0
  66. # PROP BASE Use_Debug_Libraries 0
  67. # PROP BASE Output_Dir "WinRel"
  68. # PROP BASE Intermediate_Dir "WinRel"
  69. # PROP Use_MFC 0
  70. # PROP Use_Debug_Libraries 0
  71. # PROP Output_Dir "WinRel"
  72. # PROP Intermediate_Dir "WinRel"
  73. OUTDIR=.\WinRel
  74. INTDIR=.\WinRel
  75.  
  76. ALL : $(OUTDIR)/antlr.exe $(OUTDIR)/antlr.bsc
  77.  
  78. $(OUTDIR) : 
  79.     if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
  80.  
  81. # ADD BASE CPP /nologo /W3 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" 
  82. /FR /c
  83. # ADD CPP /nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D 
  84. "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /c # SUBTRACT CPP /Fr
  85. CPP_PROJ=/nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D\
  86.  "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /Fp$(OUTDIR)/"antlr.pch" 
  87. /Fo$(INTDIR)/\  /c 
  88. CPP_OBJS=.\WinRel/
  89. # ADD BASE RSC /l 0x409 /d "NDEBUG"
  90. # ADD RSC /l 0x409 /d "NDEBUG"
  91. BSC32=bscmake.exe
  92. BSC32_SBRS= \
  93.     
  94. # ADD BASE BSC32 /nologo
  95. # ADD BSC32 /nologo
  96. BSC32_FLAGS=/nologo /o$(OUTDIR)/"antlr.bsc" 
  97.  
  98. $(OUTDIR)/antlr.bsc : $(OUTDIR)  $(BSC32_SBRS)
  99. LINK32=link.exe
  100. # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  101. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  102. odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
  103. # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  104. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  105. odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
  106. LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
  107.  advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
  108.  odbccp32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no\
  109.  /PDB:$(OUTDIR)/"antlr.pdb" /MACHINE:I386 /OUT:$(OUTDIR)/"antlr.exe" 
  110. DEF_FILE=
  111. LINK32_OBJS= \
  112.     $(INTDIR)/HASH.OBJ \
  113.     $(INTDIR)/MISC.OBJ \
  114.     $(INTDIR)/BUILD.OBJ \
  115.     $(INTDIR)/ANTLR.OBJ \
  116.     $(INTDIR)/GLOBALS.OBJ \
  117.     $(INTDIR)/PRED.OBJ \
  118.     $(INTDIR)/FSET.OBJ \
  119.     $(INTDIR)/FSET2.OBJ \
  120.     $(INTDIR)/GEN.OBJ \
  121.     $(INTDIR)/MAIN.OBJ \
  122.     $(INTDIR)/SCAN.OBJ \
  123.     $(INTDIR)/LEX.OBJ \
  124.     $(INTDIR)/ERR.OBJ \
  125.     $(INTDIR)/BITS.OBJ \
  126.     $(INTDIR)/SET.OBJ
  127.  
  128. $(OUTDIR)/antlr.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)
  129.     $(LINK32) @<<
  130.   $(LINK32_FLAGS) $(LINK32_OBJS)
  131. <<
  132.  
  133. !ELSEIF  "$(CFG)" == "Win32 Debug"
  134.  
  135. # PROP BASE Use_MFC 0
  136. # PROP BASE Use_Debug_Libraries 1
  137. # PROP BASE Output_Dir "WinDebug"
  138. # PROP BASE Intermediate_Dir "WinDebug"
  139. # PROP Use_MFC 0
  140. # PROP Use_Debug_Libraries 1
  141. # PROP Output_Dir "WinDebug"
  142. # PROP Intermediate_Dir "WinDebug"
  143. OUTDIR=.\WinDebug
  144. INTDIR=.\WinDebug
  145.  
  146. ALL : $(OUTDIR)/antlr.exe $(OUTDIR)/antlr.bsc
  147.  
  148. $(OUTDIR) : 
  149.     if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
  150.  
  151. # ADD BASE CPP /nologo /W3 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D 
  152. "_CONSOLE" /FR /c
  153. # ADD CPP /nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D 
  154. "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /c # SUBTRACT CPP /Gf /Fr
  155. CPP_PROJ=/nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32"\
  156.  /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /Fp$(OUTDIR)/"antlr.pch"\
  157.  /Fo$(INTDIR)/ /Fd$(OUTDIR)/"antlr.pdb" /c 
  158. CPP_OBJS=.\WinDebug/
  159. # ADD BASE RSC /l 0x409 /d "_DEBUG"
  160. # ADD RSC /l 0x409 /d "_DEBUG"
  161. BSC32=bscmake.exe
  162. BSC32_SBRS= \
  163.     
  164. # ADD BASE BSC32 /nologo
  165. # ADD BSC32 /nologo
  166. BSC32_FLAGS=/nologo /o$(OUTDIR)/"antlr.bsc" 
  167.  
  168. $(OUTDIR)/antlr.bsc : $(OUTDIR)  $(BSC32_SBRS)
  169. LINK32=link.exe
  170. # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  171. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  172. odbccp32.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
  173. # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  174. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  175. odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386
  176. # SUBTRACT LINK32 /MAP
  177. LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
  178.  advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
  179.  odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\
  180.  /OUT:$(OUTDIR)/"antlr.exe" 
  181. DEF_FILE=
  182. LINK32_OBJS= \
  183.     $(INTDIR)/HASH.OBJ \
  184.     $(INTDIR)/MISC.OBJ \
  185.     $(INTDIR)/BUILD.OBJ \
  186.     $(INTDIR)/ANTLR.OBJ \
  187.     $(INTDIR)/GLOBALS.OBJ \
  188.     $(INTDIR)/PRED.OBJ \
  189.     $(INTDIR)/FSET.OBJ \
  190.     $(INTDIR)/FSET2.OBJ \
  191.     $(INTDIR)/GEN.OBJ \
  192.     $(INTDIR)/MAIN.OBJ \
  193.     $(INTDIR)/SCAN.OBJ \
  194.     $(INTDIR)/LEX.OBJ \
  195.     $(INTDIR)/ERR.OBJ \
  196.     $(INTDIR)/BITS.OBJ \
  197.     $(INTDIR)/SET.OBJ
  198.  
  199. $(OUTDIR)/antlr.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)
  200.     $(LINK32) @<<
  201.   $(LINK32_FLAGS) $(LINK32_OBJS)
  202. <<
  203.  
  204. !ENDIF 
  205.  
  206. .c{$(CPP_OBJS)}.obj:
  207.    $(CPP) $(CPP_PROJ) $<  
  208.  
  209. .cpp{$(CPP_OBJS)}.obj:
  210.    $(CPP) $(CPP_PROJ) $<  
  211.  
  212. .cxx{$(CPP_OBJS)}.obj:
  213.    $(CPP) $(CPP_PROJ) $<  
  214.  
  215. ##############################################################################
  216. ## # Begin Group "Source Files"
  217.  
  218. ##############################################################################
  219. ## # Begin Source File
  220.  
  221. SOURCE=.\HASH.C
  222.  
  223. $(INTDIR)/HASH.OBJ :  $(SOURCE)  $(INTDIR)
  224.  
  225. # End Source File
  226. ##############################################################################
  227. ## # Begin Source File
  228.  
  229. SOURCE=.\MISC.C
  230.  
  231. $(INTDIR)/MISC.OBJ :  $(SOURCE)  $(INTDIR)
  232.  
  233. # End Source File
  234. ##############################################################################
  235. ## # Begin Source File
  236.  
  237. SOURCE=.\BUILD.C
  238.  
  239. $(INTDIR)/BUILD.OBJ :  $(SOURCE)  $(INTDIR)
  240.  
  241. # End Source File
  242. ##############################################################################
  243. ## # Begin Source File
  244.  
  245. SOURCE=.\ANTLR.C
  246.  
  247. $(INTDIR)/ANTLR.OBJ :  $(SOURCE)  $(INTDIR)
  248.  
  249. # End Source File
  250. ##############################################################################
  251. ## # Begin Source File
  252.  
  253. SOURCE=.\GLOBALS.C
  254.  
  255. $(INTDIR)/GLOBALS.OBJ :  $(SOURCE)  $(INTDIR)
  256.  
  257. # End Source File
  258. ##############################################################################
  259. ## # Begin Source File
  260.  
  261. SOURCE=.\PRED.C
  262.  
  263. $(INTDIR)/PRED.OBJ :  $(SOURCE)  $(INTDIR)
  264.  
  265. # End Source File
  266. ##############################################################################
  267. ## # Begin Source File
  268.  
  269. SOURCE=.\FSET.C
  270.  
  271. $(INTDIR)/FSET.OBJ :  $(SOURCE)  $(INTDIR)
  272.  
  273. # End Source File
  274. ##############################################################################
  275. ## # Begin Source File
  276.  
  277. SOURCE=.\FSET2.C
  278.  
  279. $(INTDIR)/FSET2.OBJ :  $(SOURCE)  $(INTDIR)
  280.  
  281. # End Source File
  282. ##############################################################################
  283. ## # Begin Source File
  284.  
  285. SOURCE=.\GEN.C
  286.  
  287. $(INTDIR)/GEN.OBJ :  $(SOURCE)  $(INTDIR)
  288.  
  289. # End Source File
  290. ##############################################################################
  291. ## # Begin Source File
  292.  
  293. SOURCE=.\MAIN.C
  294.  
  295. $(INTDIR)/MAIN.OBJ :  $(SOURCE)  $(INTDIR)
  296.  
  297. # End Source File
  298. ##############################################################################
  299. ## # Begin Source File
  300.  
  301. SOURCE=.\SCAN.C
  302.  
  303. $(INTDIR)/SCAN.OBJ :  $(SOURCE)  $(INTDIR)
  304.  
  305. # End Source File
  306. ##############################################################################
  307. ## # Begin Source File
  308.  
  309. SOURCE=.\LEX.C
  310.  
  311. $(INTDIR)/LEX.OBJ :  $(SOURCE)  $(INTDIR)
  312.  
  313. # End Source File
  314. ##############################################################################
  315. ## # Begin Source File
  316.  
  317. SOURCE=.\ERR.C
  318.  
  319. $(INTDIR)/ERR.OBJ :  $(SOURCE)  $(INTDIR)
  320.  
  321. # End Source File
  322. ##############################################################################
  323. ## # Begin Source File
  324.  
  325. SOURCE=.\BITS.C
  326.  
  327. $(INTDIR)/BITS.OBJ :  $(SOURCE)  $(INTDIR)
  328.  
  329. # End Source File
  330. ##############################################################################
  331. ## # Begin Source File
  332.  
  333. SOURCE=\pccts\SUPPORT\SET\SET.C
  334.  
  335. $(INTDIR)/SET.OBJ :  $(SOURCE)  $(INTDIR)
  336.    $(CPP) $(CPP_PROJ)  $(SOURCE) 
  337.  
  338. # End Source File
  339. # End Group
  340. # End Project
  341. ##############################################################################
  342. ##
  343.  
  344. File dlg.mak:
  345.  
  346. # Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
  347. # ** DO NOT EDIT **
  348.  
  349. # TARGTYPE "Win32 (x86) Console Application" 0x0103
  350.  
  351. !IF "$(CFG)" == ""
  352. CFG=Win32 Debug
  353. !MESSAGE No configuration specified.  Defaulting to Win32 Debug.
  354. !ENDIF 
  355.  
  356. !IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
  357. !MESSAGE Invalid configuration "$(CFG)" specified.
  358. !MESSAGE You can specify a configuration when running NMAKE on this makefile
  359. !MESSAGE by defining the macro CFG on the command line.  For example:
  360. !MESSAGE 
  361. !MESSAGE NMAKE /f "dlg.mak" CFG="Win32 Debug"
  362. !MESSAGE 
  363. !MESSAGE Possible choices for configuration are:
  364. !MESSAGE 
  365. !MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
  366. !MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
  367. !MESSAGE 
  368. !ERROR An invalid configuration is specified.
  369. !ENDIF 
  370.  
  371. ##############################################################################
  372. ## # Begin Project
  373. # PROP Target_Last_Scanned "Win32 Release"
  374. CPP=cl.exe
  375. RSC=rc.exe
  376.  
  377. !IF  "$(CFG)" == "Win32 Release"
  378.  
  379. # PROP BASE Use_MFC 0
  380. # PROP BASE Use_Debug_Libraries 0
  381. # PROP BASE Output_Dir "WinRel"
  382. # PROP BASE Intermediate_Dir "WinRel"
  383. # PROP Use_MFC 0
  384. # PROP Use_Debug_Libraries 0
  385. # PROP Output_Dir "WinRel"
  386. # PROP Intermediate_Dir "WinRel"
  387. OUTDIR=.\WinRel
  388. INTDIR=.\WinRel
  389.  
  390. ALL : $(OUTDIR)/dlg.exe $(OUTDIR)/dlg.bsc
  391.  
  392. $(OUTDIR) : 
  393.     if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
  394.  
  395. # ADD BASE CPP /nologo /W3 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" 
  396. /FR /c
  397. # ADD CPP /nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D 
  398. "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /c # SUBTRACT CPP /Fr
  399. CPP_PROJ=/nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D\
  400.  "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /Fp$(OUTDIR)/"dlg.pch" /Fo$(INTDIR)/ 
  401. /c CPP_OBJS=.\WinRel/
  402. # ADD BASE RSC /l 0x409 /d "NDEBUG"
  403. # ADD RSC /l 0x409 /d "NDEBUG"
  404. BSC32=bscmake.exe
  405. BSC32_SBRS= \
  406.     
  407. # ADD BASE BSC32 /nologo
  408. # ADD BSC32 /nologo
  409. BSC32_FLAGS=/nologo /o$(OUTDIR)/"dlg.bsc" 
  410.  
  411. $(OUTDIR)/dlg.bsc : $(OUTDIR)  $(BSC32_SBRS)
  412. LINK32=link.exe
  413. # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  414. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  415. odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
  416. # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  417. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  418. odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
  419. LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
  420.  advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
  421.  odbccp32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no\
  422.  /PDB:$(OUTDIR)/"dlg.pdb" /MACHINE:I386 /OUT:$(OUTDIR)/"dlg.exe" 
  423. DEF_FILE=
  424. LINK32_OBJS= \
  425.     $(INTDIR)/SET.OBJ \
  426.     $(INTDIR)/AUTOMATA.OBJ \
  427.     $(INTDIR)/SUPPORT.OBJ \
  428.     $(INTDIR)/DLG_P.OBJ \
  429.     $(INTDIR)/ERR.OBJ \
  430.     $(INTDIR)/MAIN.OBJ \
  431.     $(INTDIR)/DLG_A.OBJ \
  432.     $(INTDIR)/RELABEL.OBJ \
  433.     $(INTDIR)/OUTPUT.OBJ
  434.  
  435. $(OUTDIR)/dlg.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)
  436.     $(LINK32) @<<
  437.   $(LINK32_FLAGS) $(LINK32_OBJS)
  438. <<
  439.  
  440. !ELSEIF  "$(CFG)" == "Win32 Debug"
  441.  
  442. # PROP BASE Use_MFC 0
  443. # PROP BASE Use_Debug_Libraries 1
  444. # PROP BASE Output_Dir "WinDebug"
  445. # PROP BASE Intermediate_Dir "WinDebug"
  446. # PROP Use_MFC 0
  447. # PROP Use_Debug_Libraries 1
  448. # PROP Output_Dir "WinDebug"
  449. # PROP Intermediate_Dir "WinDebug"
  450. OUTDIR=.\WinDebug
  451. INTDIR=.\WinDebug
  452.  
  453. ALL : $(OUTDIR)/dlg.exe $(OUTDIR)/dlg.bsc
  454.  
  455. $(OUTDIR) : 
  456.     if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
  457.  
  458. # ADD BASE CPP /nologo /W3 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D 
  459. "_CONSOLE" /FR /c
  460. # ADD CPP /nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D 
  461. "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /c # SUBTRACT CPP /Fr
  462. CPP_PROJ=/nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32"\
  463.  /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /Fp$(OUTDIR)/"dlg.pch" 
  464. /Fo$(INTDIR)/\  /Fd$(OUTDIR)/"dlg.pdb" /c 
  465. CPP_OBJS=.\WinDebug/
  466. # ADD BASE RSC /l 0x409 /d "_DEBUG"
  467. # ADD RSC /l 0x409 /d "_DEBUG"
  468. BSC32=bscmake.exe
  469. BSC32_SBRS= \
  470.     
  471. # ADD BASE BSC32 /nologo
  472. # ADD BSC32 /nologo
  473. BSC32_FLAGS=/nologo /o$(OUTDIR)/"dlg.bsc" 
  474.  
  475. $(OUTDIR)/dlg.bsc : $(OUTDIR)  $(BSC32_SBRS)
  476. LINK32=link.exe
  477. # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  478. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  479. odbccp32.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
  480. # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
  481. advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
  482. odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386
  483. LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
  484.  advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
  485.  odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\
  486.  /OUT:$(OUTDIR)/"dlg.exe" 
  487. DEF_FILE=
  488. LINK32_OBJS= \
  489.     $(INTDIR)/SET.OBJ \
  490.     $(INTDIR)/AUTOMATA.OBJ \
  491.     $(INTDIR)/SUPPORT.OBJ \
  492.     $(INTDIR)/DLG_P.OBJ \
  493.     $(INTDIR)/ERR.OBJ \
  494.     $(INTDIR)/MAIN.OBJ \
  495.     $(INTDIR)/DLG_A.OBJ \
  496.     $(INTDIR)/RELABEL.OBJ \
  497.     $(INTDIR)/OUTPUT.OBJ
  498.  
  499. $(OUTDIR)/dlg.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)
  500.     $(LINK
  501.  
  502. SOURCE=.\DLG_A.C
  503.  
  504. $(INTDIR)/DLG_A.OBJ :  $(SOURCE)  $(INTDIR)
  505.  
  506. # End Source File
  507. ##############################################################################
  508. ## # Begin Source File
  509.  
  510. SOURCE=.\RELABEL.C
  511.  
  512. $(INTDIR)/RELABEL.OBJ :  $(SOURCE)  $(INTDIR)
  513.  
  514. # End Source File
  515. ##############################################################################
  516. ## # Begin Source File
  517.  
  518. SOURCE=.\OUTPUT.C
  519.  
  520. $(INTDIR)/OUTPUT.OBJ :  $(SOURCE)  $(INTDIR)
  521.  
  522. # End Source File
  523. # End Group
  524. # End Project
  525. ##############################################################################
  526. ##
  527.  
  528. -------------------------------------
  529.  
  530.          How to port PCCTS 1.10 (and 1.20 hopefully) to Visual C++
  531.  
  532.                                    By
  533.  
  534.                        John Hall <jhall@ivy.wpi.edu>
  535.  
  536. Here is how to compile an ANTLR grammar in Visual C++.  These steps
  537. describe how to have your ANTLR grammar parse the input file the user
  538. selects when they choose File Open in your Windows application.  (Even
  539. if you aren't using Visual C++, the steps should be portable enough to
  540. other compilers.)
  541.  
  542.  * Make sure that ANTLR and DLG generate ANSI code (use the -ga
  543.    switch).
  544.  
  545.  * Set the following compiler flags in Visual C++ (these are in the
  546.    Memory Model category of the compiler options in the Project
  547.    Options menu):
  548.  
  549.    FLAG MEANING
  550.    ==== ==============================================================
  551.    /AL    Large memory model (multiple data segments; data items must be
  552.     smaller than 64K).
  553.  
  554.    /Gtn    Allocates all items whose size is greater than or equal to n
  555.     in a new data segment.  (I let n be 256: /Gt256.)
  556.  
  557.    /Gx-    All references to data items are done with far addressing in
  558.     case they are placed in a far segment.
  559.  
  560.  * Add the following member variable to the attributes section of your
  561.    derived CDocument class (you will need to make sure you also
  562.    include stdio.h):
  563.  
  564.    FILE *fp;
  565.  
  566.  * Add the following method to your derived CDocument class:
  567.  
  568.    BOOL CAppDoc::OnOpenDocument(const char* pszPathName)
  569.    {
  570.        // Call CDocument's OnOpenDocument to do housekeeping for us
  571.        // DON'T add anything to the loading section of Serialize
  572.        if (!CDocument::OnOpenDocument(pszPathName))
  573.            return FALSE;
  574.    
  575.        // Open input file
  576.        if ((fp = fopen(pszPathName, "r")) == NULL)
  577.            return FALSE;
  578.    
  579.        // Parse input file
  580.        ANTLR(start(), fp);
  581.    
  582.        // Close input file
  583.        fclose(fp);
  584.        return TRUE;
  585.    }
  586.  
  587.    (Note: additional code may be necessary, depending on your parser.
  588.    For example, if your parser uses PCCTS's symbol table library, you
  589.    will need to insert calls to zzs_init and zzs_done.)
  590.  
  591.  * Compile the generated C files as C++ files.  (I renamed the files
  592.    to have a .CPP extension to fool Visual C++ into thinking they were
  593.    C++ files.  One might also use the /Tp switch, but that switch
  594.    requires you separately include the filename.)  [I used this step
  595.    as an easy out for all the external linking errors I was getting
  596.    that I couldn't fix by declaring things extern "C".]
  597.  
  598.  * Make sure the __STDC__ portion of the generated files gets
  599.    compiled.  (Either define __STDC__ yourself or else change all
  600.    occurrences of __STDC__ to __cplusplus in the generated files.  You
  601.    can define __STDC__ in the Preprocessor category of the compiler
  602.    options.)
  603.  
  604. That last step is important for Visual C++, but may not apply to other
  605. compilers.  For C++ compilers, whether __STDC__ is defined is
  606. implementation dependent (ARM, page 379).  Apparently, Visual C++ does
  607. not to define it; it also does not support "old style" C function
  608. definitions (which is okay, according to page 404 of the ARM).  Those
  609. two things together caused problems when trying to port the code.
  610. When it saw this:
  611.  
  612. #ifdef __STDC__
  613. void
  614. globals(AST **_root)
  615. #else
  616. globals(_root)
  617. AST **_root;
  618. #endif
  619.  
  620. it skipped the __STDC__ section and tried to process the "old style"
  621. function definition, where it choked.
  622.  
  623. When you finally get your parser to compile and link without error,
  624. you may get General Protection Fault errors at run time.  The problem
  625. I had was that a NULL was passed to a variable argument function
  626. without an explicit cast.  The function grabbed a pointer (32-bits)
  627. off the stack using va_arg, but the NULL was passed silently as the
  628. integer 0 (16 bits), making the resulting pointer was invalid.  (This
  629. was in PCCTS's sample C parser.)
  630.  
  631. There is one other thing I might suggest to help you avoid a run-time
  632. error.  Make sure you redefine the default error reporting function,
  633. zzsyn.  To do this, put "#define USER_ZZSYN" in your #header section
  634. and put your own zzsyn somewhere.  You can then pop up a MessageBox or
  635. print the error to some output window.
  636.  
  637.